package com.jfl.mapper;

import org.apache.ibatis.annotations.Select;

import com.jfl.base.BaseMapper;
import com.jfl.model.SysDept;

/**
 * 
 * @author  赵炎
 * @version  [V1.00, 2018年12月11日]
 * @since V1.00
 */
public interface SysDeptMapper extends BaseMapper<SysDept>
{

    @Select("select * from tbl_sys_dept where dept_name = #{deptName} and enable = 1")
    SysDept selectDeptByName(String deptName);

    @Select("select count(1) from tbl_sys_dept where parent_id = #{parentId}")
    int selectCountByParentId(Long parentId);
    
    @Select("select count(1) from tbl_sys_user where dept_id = #{deptId}")
    int selectCountUserByDeptId(Long deptId);

}
